Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: test central host UI #81

Open
wants to merge 1 commit into
base: experimentation-v2-integration
Choose a base branch
from

Conversation

FentPams
Copy link
Collaborator

@FentPams FentPams commented Jul 31, 2024

This PR is for testing the feasibility of using central-host plugin's UI files (preview.js, preview.css) on GitHub Pages (https://github.com/FentPams/FentPams.github.io). The goal is to see if we can effectively host and display these files through GitHub Pages and use this as a reference for future implementations on admin.aem.live.

preivew.js and preivew.css files on Github pages:

Code changes:

  • index.js, passing the context needed for preview.js, and import the url that points to the remote preview.js:
export async function loadLazy(document, options = {}) {
  const pluginOptions = { ...DEFAULT_OPTIONS, ...options };
  // do not show the experimentation pill on prod domains
  if (!isDebugEnabled) {
    return;
  }
  // eslint-disable-next-line import/no-cycle
  const preview = await import('https://fentpams.github.io/lab/preview.js');
  const context = {
    getMetadata,
    toClassName,
    debug,
  };
  preview.default.call(context, document, pluginOptions);
}

Screenshots of changing overlay pill's color in preview.css

Screenshot 2024-07-31 at 8 12 46 AM

Test URLs:

Copy link

aem-code-sync bot commented Jul 31, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Jul 31, 2024

Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@FentPams
Copy link
Collaborator Author

@ramboz Hosting on github pages is workable :) Appreciate your thoughts here.

Copy link
Collaborator

@ramboz ramboz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great :)

You can probably create a new branch then directly in the aem experimentation repo for the pages, and I'll configure the repo to point to that branch for the code. That way we can load directly from https://adobe.github.io/aem-experimentation/preview.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants